package cn.com.server.service.impl;

import cn.com.server.dao.GroupDao;
import cn.com.server.entity.Group;
import cn.com.server.service.GroupService;
import cn.com.server.extend.model.GroupModel;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;

/**
 * <p>
 * 用户组表 服务实现类
 * </p>
 *
 * @author qing
 * @since 2017-11-20
 */
@Service
public class GroupServiceImp implements GroupService {
	
	@Autowired
	private GroupDao dao;
	
	
	@Override
	public List<Group> selectByRegisterFlg(Boolean registerFlg){
		return dao.selectByRegisterFlg(registerFlg);
	}
	
	@Override
	public Page<Group> selectGroupList(GroupModel model){
		PageHelper.startPage(model.getPage(), model.getLimit());
		Page<Group> pageData = dao.selectGroupList(model);
		return pageData;
	}
	
	@Override
	public Group selectGroupByRoleId(Long roleId) {
		return dao.selectGroupByRoleId(roleId);
	}
}
